/**
 * Created with IntelliJ IDEA.
 * Description :
 * User: $ {USER}
 * Date: $ {YEAR}-$ {MONTH}一$ { DAY}
 * Time: ${ TIME}
 */
/*
public class Test {
    public static void main(String[] args) {
        Student student = new Student();
        System.out.println(student.classroom);
        System.out.println(Student.classroom);
    }
}

class Student{
    public String name;
    public int age;
    public static int classroom = 103;
    public Student(){
        System.out.println("不带参数的构造方法");
    }
    public static void func(){
        //System.out.println("姓名："+name+"年龄："+age);
        System.out.println("教室号："+classroom);
    }

    */
/*public static void func(String name , int age){
        System.out.println("姓名："+this.name+"年龄："+this.age);
        System.out.println("教室号："+classroom);
    }*//*

}*/


/*

class Student{
    //实例成员变量
    public String name;
    public int age;
    public static int classroom;

    //构造块
    {
        name = "zhangsan";
        age = 18;
    }

    //static修饰
    static{
        classroom = 103;
    }
}*/


/*class Dog{
    public int age;
    public String toString(){
        //如果有多个成员变量就需要把多个成员变量都写上
        return "["+"age:"+age+"]";
    }
}
public class Test {
   public static void main(String[] args){
       Dog b = new Dog();//实例化一个对象
       System.out.println(b.toString());
       //打印成员变量
       //System.out.println(b.age);
       //打印的是一个地址，因为b是一个引用
       //System.out.println(b);
   }
}*/


/*
class Dog{
    public String name;
    public int age;
    //构造方法来初始化成员变量
    public Dog(String name, int age){
        this.name = name;
        this.age = age;
    }
    //来打印成员变量
    public void show(){
        System.out.println("name:"+this.name+"age:"+this.age);
    }
}

class Cat{
    public String name;
    public int age;
    //构造方法来初始化成员变量
    public Cat(String name, int age){
        this.name = name;
        this.age = age;
    }
    //来打印成员变量
    public void show(){
        System.out.println("name:"+this.name+"age:"+age);
    }
}
*/

/*
class Animol{
    //这些成员变量和成员方法都是Dog和Cat共有的，因此放到父类
    public String name;
    public int age;
    public void show(){
        System.out.println("name:"+this.name+"age:"+age);
    }
}
//    子类 extends 父类
class Dog extends Animol{

    //构造方法来初始化成员变量
    public Dog(String name, int age){
        this.name = name;
        this.age = age;
    }
}

//    子类 extends 父类
class Cat extends Animol{

    //构造方法来初始化成员变量
    public Cat(String name, int age){
        this.name = name;
        this.age = age;
    }
}
*/